home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
C and C++
/
Commun⁄Network
/
NetNews Sample Code ƒ
/
News src
/
CNewsApp.c
< prev
next >
Wrap
Text File
|
1990-10-16
|
2KB
|
110 lines
/*
* CNewsApp.c
*
* Application methods for a simple netnews reader
*/
#include <Commands.h>
#include "CNewsApp.h"
#define ALERTabout 120
extern OSType gSignature;
/***
* IStarterApp
***/
void CNewsApp::IStarterApp(void)
{
CApplication::IApplication(4, 20480L, 2048L);
}
/***
* SetUpFileParameters
***/
void CNewsApp::SetUpFileParameters(void)
{
inherited::SetUpFileParameters(); /* call the default method */
sfNumTypes = 1;
sfFileTypes[0] = 'TEXT';
gSignature = '????';
}
/***
* SetUpMenus
*
* Set up menus which must be created at run time, such as a
* Font menu. You can eliminate this method if your application
* does not have any such menus.
*
***/
void CNewsApp::SetUpMenus()
{
inherited::SetUpMenus(); /* Superclass takes care of adding
menus specified in a MBAR id = 1
resource
*/
}
/***
* DoCommand
*
***/
void CNewsApp::DoCommand(long theCommand)
{
switch (theCommand) {
case cmdAbout:
Alert(ALERTabout, 0);
break;
default: inherited::DoCommand(theCommand);
break;
}
}
/***
*
* UpdateMenus
*
* Perform menu management tasks
*
***/
void CNewsApp::UpdateMenus()
{
inherited::UpdateMenus(); /* Enable standard commands */
}
/*
* Exit
*
*/
void CNewsApp::Exit()
{
close_server();
save_newsrc();
}
void CNewsApp::StartUpAction(short numPreloads)
{
init_news();
}